<include file="/public/header" />
<div class="layui-fluid">
    <div class="layui-card">
        <!-- // 默认操作按钮 -->
        <div class="layui-card-header layuiadmin-card-header-auto ">
        <div class="layui-form">
            <div class="layui-form-item">
            	<div class="layui-inline">

            		<button class="layui-btn layui-btn-sm layui-btn-primary icon-btn" lay-filter="formSearch" lay-submit>
            			<i class="layui-icon layui-icon-refresh"></i>
            		</button>

            		<button class="layui-btn layui-btn-sm icon-btn" lay-batch="lay-tableList" lay-url="{$controller}restore">
            			<i class="layui-icon layui-icon-link"></i>{:__('还原')}
            		</button>

            		<button class="layui-btn layui-btn-sm layui-btn-warm icon-btn" lay-batch="lay-tableList" lay-url="{$controller}destroy" >
            			<i class="layui-icon layui-icon-unlink"></i>{:__('销毁')}
            		</button>

            		<button class="layui-btn layui-btn-sm icon-btn" lay-ajax="" lay-table="lay-tableList" lay-url="{$controller}restore" >
            			<i class="layui-icon layui-icon-engine"></i>{:__('一键还原')}
            		</button>

            		<button class="layui-btn layui-btn-sm layui-btn-danger icon-btn" lay-ajax="" lay-table="lay-tableList" lay-url="{$controller}destroy" >
            			<i class="layui-icon layui-icon-delete"></i>{:__('清空回收站')}
            		</button>
            		
            	</div>
            	<div class="layui-inline">
            		<div class="layui-input-inline "><input name="title" class="layui-input" type="text" placeholder="{:__('搜索名称')}"/></div>
            	</div>
	            <div class="layui-inline">
	                <!-- // 默认搜索 -->
	                <button class="layui-btn layui-btn-sm icon-btn" lay-filter="formSearch" lay-submit>
	                    <i class="layui-icon layui-icon-search"></i>{:__('搜索')}
	                </button>
	            </div>

            </div>
        </div> 

        </div>

        <!-- // 创建数据实例 -->
        <table id="lay-tableList" lay-filter="lay-tableList"></table>        
    </div>
</div>

<!-- // 列表编辑框 -->
<script type="text/html" id="tableBar"> 
    <a class="icon-btn" lay-url="{$controller}restore/id/{{d.id}}" lay-event="ajax" >
        <i class="layui-icon layui-icon-refresh-3" style="font-size: 13px;margin-right: 2px"></i>{:__('还原')}</a>
    <div class="layui-divider layui-divider-vertical"></div>
    <a class="icon-btn" lay-url="{$controller}destroy/id/{{d.id}}" lay-event="del" ><i class="layui-icon layui-icon-close"></i>{:__('销毁')}</a>
</script>
<include file="/public/footer" />
<script>
    layui.use(['admin','table','util'], function () {
        var jquery = layui.jquery;
        var table = layui.table;
        var url = '{$controller}';
        /*
         * 初始化表格
        */
        var isTable = table.render({
            elem: "#lay-tableList"
            ,url: url + 'recyclebin'
            ,page: true
            ,cols: [[
                {type: 'checkbox', width:45},
                {field: 'id', align: 'center',sort: true,width: 60,  title: 'ID'},
                {field: 'title', align: 'left', title: "{:__('名称')}"},
                {field: 'delete_time', align: 'center',width:180,
                		templet: '<div>{{ layui.util.toDateString(d.delete_time*1000, "yyyy-MM-dd HH:mm:ss") }}</div>',title: "{:__('删除时间')}"},
                {align: 'center', toolbar: '#tableBar', width:150, title: "{:__('操作')}"},
            ]]
        })
    })
</script>
